import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import Antd from 'ant-design-vue'
import 'ant-design-vue/dist/reset.css'

/*===========================axios===========================*/
import axios from 'axios'
axios.defaults.baseURL = process.env.VUE_APP_SERVER
//请求拦截器
axios.interceptors.request.use(
  function (config) {
    console.log('请求参数：', config)
    return config
  },
  (error) => {
    return Promise.reject(error)
  }
)
//过滤拦截器
axios.interceptors.response.use(
  function (response) {
    console.log('返回结果：', response.data)
    return response
  },
  (error) => {
    console.log('返回错误：', error)
    return Promise.reject(error)
  }
)
/*===========================axios===========================*/

const app = createApp(App)

app.use(router).use(store).use(Antd).mount('#app')
//createApp(App).use(store).use(router).mount('#app')
